Skip to content

feature: migrate Gradle build to Spring Boot 3.3.13 / Java 17 - #66

Open
amitmanchella-cog wants to merge 1 commit into
masterfrom
devin/migration-gradle-build
Open

amitmanchella-cog wants to merge 1 commit into
masterfrom
devin/migration-gradle-build

Conversation

@amitmanchella-cog

@amitmanchella-cog amitmanchella-cog commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Gradle half of the Java 8 / Spring Boot 2.0.2 → Java 17 / Spring Boot 3.3 migration. Scope is strictly build.gradle + the wrapper; pom.xml and src/ are owned by sibling PRs.

  • buildscript { classpath 'spring-boot-gradle-plugin:2.0.2.RELEASE' } + apply plugin:plugins { id 'org.springframework.boot' version '3.3.13'; id 'io.spring.dependency-management' version '1.1.7' }
  • Java 1.8 → 17, set via the java { } extension (the project-level sourceCompatibility = convention is deprecated in Gradle 8.11+)
  • compile/testCompile (removed in Gradle 7) → implementation/testImplementation; junit:junitspring-boot-starter-test with useJUnitPlatform()
  • bootJar { baseName / version }archiveBaseName / archiveVersion
  • Added spring-boot-starter-jdbc and com.h2database:h2 so the Gradle dependency set matches pom.xml
  • Wrapper 4.6 → 8.14.5 (Boot 3.3 requires Gradle 7.5+; 4.6 cannot run on Java 17)

Verification

Build config only — end-to-end compilation is expected to fail until the sibling src/ migration lands, so verification was limited to Gradle configuration + dependency resolution on JDK 17:

./gradlew tasks          # BUILD SUCCESSFUL
./gradlew dependencies --configuration runtimeClasspath
# spring-boot-starter-web -> 3.3.13 (spring-web 6.1.21, tomcat-embed-core 10.1.42)
# spring-boot-starter-jdbc -> 3.3.13 (spring-jdbc 6.1.21, HikariCP 5.1.0)
# com.h2database:h2 -> 2.2.224

Link to Devin session: https://app.devin.ai/sessions/24a54e2415054076ac2aefb4ca3a7677
Requested by: @amitmanchella-cog


Open in Devin Review

Co-Authored-By: Amit Manchella <amit.manchella@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

Open in Devin Review

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Wrapper JAR and scripts are still Gradle 2.13 while the distribution URL jumps to 8.x

gradle/wrapper/gradle-wrapper.jar reports versionNumber=2.13 (build-receipt inside the jar, built 2016) and gradlew/gradlew.bat are the matching legacy scripts — only distributionUrl was bumped. Normally the wrapper is regenerated via ./gradlew wrapper --gradle-version 8.14.5, which updates the jar, both scripts and the properties file together. A 2016 wrapper jar bootstrapping a Gradle 8 distribution on JDK 17 usually still works (the author reports ./gradlew tasks succeeded), so this isn't flagged as a bug, but it leaves the repo in an inconsistent state (no distributionSha256Sum support, old script logic, missing networkTimeout handling) and is worth regenerating as part of this migration.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and intentionally left out of this PR: the scope for this session is build.gradle plus gradle-wrapper.properties only, since sibling sessions are editing the repo in parallel and ./gradlew wrapper --gradle-version 8.14.5 would also rewrite gradlew, gradlew.bat and gradle-wrapper.jar. The legacy bootstrap does work (verified ./gradlew tasks and ./gradlew dependencies on JDK 17); regenerating the full wrapper is a good cleanup follow-up.

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Gradle 8.14.5 distribution must be verified to exist

If gradle-8.14.5-bin.zip is not a published distribution, every wrapper invocation fails at download time with an opaque error. Worth confirming against https://services.gradle.org/distributions/ (the author's verification log only shows ./gradlew tasks output, not which distribution was resolved).

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified — the wrapper actually downloaded and ran that distribution in this session: ~/.gradle/wrapper/dists/gradle-8.14.5-bin was populated by ./gradlew tasks, and Gradle's own output references https://docs.gradle.org/8.14.5/.... 8.14.5 is the latest 8.x release (Boot 3.3 does not support Gradle 9).

Comment thread build.gradle
Comment on lines 23 to +26
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("junit:junit")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("com.h2database:h2")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Gradle dependency set does not fully match pom.xml (properties-migrator missing)

The PR states the Gradle dependency set now matches pom.xml, but pom.xml also declares org.springframework.boot:spring-boot-properties-migrator with runtime scope, which has no Gradle counterpart (runtimeOnly(...)). Given this is a Boot 2 → 3 migration where the migrator's property-rename warnings are most useful, the omission is likely unintentional (or the migrator should be dropped from pom.xml in the sibling PR for consistency).

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional: spring-boot-properties-migrator is being dropped from pom.xml in the sibling Maven PR as part of this migration, so adding a runtimeOnly counterpart here would immediately need reverting. Once that lands, both builds match.

Comment thread build.gradle
Comment on lines 17 to +20

sourceCompatibility = 1.8
targetCompatibility = 1.8
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: source/targetCompatibility instead of a Java toolchain

Setting sourceCompatibility/targetCompatibility inside java { } only asserts the language level; the build still requires the invoking JDK to be 17+ and fails with a confusing 'invalid source release' / plugin-incompatibility error on an older JDK. Since this repo previously built on JDK 8, java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } would make the requirement explicit and let Gradle provision/select the right JDK.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deliberate for this PR — the migration plan specifies sourceCompatibility/targetCompatibility 1.8 → 17, and a toolchain would additionally make Gradle try to auto-provision/select a JDK, which changes build behaviour beyond the scope here. Happy to switch to java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } as a follow-up if preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant